Ti.include("/struct/common.js");

// this sets the background color of the master UIView (when there are no windows/tab groups on it)
Titanium.UI.setBackgroundColor('#fff');


S.mainWin = Ti.UI.createWindow(S.combine($$.mainWindow));

/* LOADING INDICATOR */
var loadingIndicator = Ti.UI.createView(S.combine($$.loadingIndicator));
var loadingIndicatorImg = Ti.UI.createImageView(S.combine($$.loadingIndicatorImg));
loadingIndicator.add(loadingIndicatorImg);


Ti.App.addEventListener('app:isLoading', function(e) {
	loadingIndicator.visible = true;
	loadingIndicatorImg.start();
});
Ti.App.addEventListener('app:doneLoading', function(e) {
	loadingIndicator.visible = false;
	loadingIndicatorImg.stop();
});



S.mainWin.open();
S.mainWin.add(loadingIndicator);

Ti.App.fireEvent("app:isLoading");
S.ui.initInterface({force:false});





//S.app.mood = "RADIANT!";
//Ti.App.fireEvent("app:mood.update");
//setTimeout(function(){Ti.App.fireEvent("app:msg",{msg:"Welcome!"});},1000);